package com.atguigu03.date.exer2;

import org.junit.Test;

import java.util.Calendar;
import java.util.Date;

/**
 * ClassName: CalenderAndLocalDateTime
 * Package: com.atguigu03.date.exer2
 * Description:
 *
 * @Author BuTang
 * @Create 2023/5/24 15:19
 * @Version 1.0
 */
public class CalenderAndLocalDateTime {
    @Test
    public void test1(){
        Calendar c = Calendar.getInstance();
        System.out.println(c.get(Calendar.YEAR));



        c.set(Calendar.DAY_OF_YEAR , 12);
        c.set(Calendar.YEAR,2012);
        Date date = c.getTime();

        System.out.println("生日为"+date);
        c.add(Calendar.DAY_OF_YEAR,100);
        //System.out.println(c);
        date = c.getTime();
        System.out.println("百天后为"+date);
    }
}
